<?php

namespace App\Helpers\Api;


use Illuminate\Http\Request;

trait InfoTrait
{

    public function info(Request $request) {
        $model = new $this->model;
        $table = $model->getTable();
        $this->validate($request, [
            'id' => 'required|exists:' . $table . ",id"
        ]);
        $id = \request("id");
        $info = $this->model::find($id);
        return $this->success($info);
    }

}
